#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @File : contact_page.py
# @Autor: FY
# @Date: 2021/8/30
from selenium.webdriver.common.by import By

from pages.base_page import BasePage
from time import sleep


class ContactPage(BasePage):

    def get_phones(self):
        '''
        获取通讯录中所有的手机号码
        :return: list
        '''
        phones = []
        sleep(3)
        eles = self.find_elements(By.XPATH, '//*[@id="member_list"]//td[5]')
        for ele in eles:
            phone = ele.text
            phones.append(phone)

        return phones